<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BOM对象</title>
</head>
<body>
<script>

  alert('hello world');
  confirm('hello world');
  var a = prompt();
  console.log(a);

  //定时器
  var i = 60;
  setInterval(function (){
   document.write(i);
   i--;
      //关闭计时器
      if(i==0){
          clearInterval();
      }
  },1000);


//固定时间之后执行一次
  setTimeout(()=>{
      alert("5s之后输出的结果为："+i);
      location.href="http://www.baidu.com"
  },5000);

  history.go(0);//刷新页面
  screen.availHeight;
</script>
</body>
</html>